<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Add a lexer rule</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="parle-lexer.insertmacro.html">« Parle\Lexer::insertMacro</a></li>
      <li style="float: right;"><a href="parle-lexer.reset.html">Parle\Lexer::reset »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.parle-lexer.html">Parle\Lexer</a></li>
    <li>Add a lexer rule</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="parle-lexer.push" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Parle\Lexer::push</h1>
  <p class="verinfo">(PECL parle &gt;= 0.5.1)</p><p class="refpurpose"><span class="refname">Parle\Lexer::push</span> &mdash; <span class="dc-title">Add a lexer rule</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-parle-lexer.push-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Parle\Lexer::push</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$regex</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$id</code></span>): <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
   Push a pattern for lexeme recognition.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-parle-lexer.push-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">regex</code></dt>

    <dd>

     <p class="para">
      Regular expression used for token matching.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">id</code></dt>

    <dd>

     <p class="para">
      Token id. If the lexer instance is meant to be used standalone, this can be an arbitrary number. If the lexer instance is going to be passed to the parser, it has to be an id returned by <span class="methodname"><a href="parle-parser.tokenid.html" class="methodname">Parle\Parser::tokenid()</a></span>.
     </p>
    </dd>

   
   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-parle-lexer.push-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。   
  </p>
 </div>



</div></div></div></body></html>